home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / batchlrn.arc / IFEXIST.HLP < prev    next >
Text File  |  1991-06-17  |  3KB  |  47 lines

  1.                 #
  2.                 #
  3. |---------------B A T C H L R N  H E L P  S Y S T E M-----------------|
  4. |command: IF EXIST                                                    |
  5. |use: The IF EXIST cmnd. allows CONFIRMATION of a file or condition.  |
  6. |                                                                     |
  7. |how: Type:IF EXIST <filename.ext> or <condition> [then]  <cmnd.> O-R |
  8. |          IF NOT EXIST <same as above>                               |
  9. |                                                                     |
  10. |example: IF EXIST %1 GOTO EXISTS                                     |
  11. |         ECHO     . . . T H E  F I L E  D O E S N ' T  E X I S T !   |
  12. |         :EXISTS                                                     |
  13. |         ECHO  ...%1 IS AN EXISTING FILE IN THE CURRENT DIRECTORY!   |
  14. |                                      |
  15. | If you were to type:"EXIST SWELL.TXT" and it DID NOT EXIST the      |
  16. | statement would be FALSE and the batch file would move to the next  |
  17. | line, displaying: ...THE FILE DOES NOT EXIST! If you typed the same |
  18. | phrase, and the file WAS in the CURRENT directory the statement     |
  19. | would be true and the batch file would JUMP to the label "EXISTS".  |
  20. | It would then display the message: ...SWELL.TXT [that's the %1] IS  |
  21. | AN EXISTING FILE IN THE CURRENT DIRECTORY! Using this basic shell   |
  22. | you can create many IF EXIST batch processing files to make your    |
  23. | work easier. FOR CROSS-REFERENCE SEE THE IF.HLP FILE!               |
  24. |NOTES: When <condition> is TRUE, DOS or batch <command> is performed.|
  25. | When <condition> is NOT TRUE,the <command> is IGNORED and the next  |
  26. | line in the batch processing file is performed.                     |
  27. | The<condition> we are "testing" here, IF EXIST o-r NOT EXIST is ill-|
  28. | illustrated by these two examples:                                  |
  29. |                                                                     |
  30. |         IF EXIST = True if and only if <filename> exists.           |
  31. |                                                                     |
  32. |     IF NOT EXIST = True if and only if <condition> is false.        |
  33. |                                                                     |
  34. |      Another example of IF EXIST (>Condition 3) is as follows:      |
  35. |   >Condition 3:The logical test for checking for the existence of a |
  36. | file has as its format: EXIST C:<filename.ext>                      |
  37. | You can use this test to check and see if a file is in C: drive     |
  38. | (as in the example). EXIST B:<filename.ext> might be used to check  |
  39. | to see if B: drive has a DOS disk in the drive. Explore other uses  |
  40. | after examining files on this disk with "EXIST". Note: you cannot   |
  41. | use pathnames for checking on a file's existence.                   |
  42. |                                          |
  43. |READER NOTE:The IF & IF EXIST cmnds are important to you. Review THIS|
  44. | file & IF.HLP,then s-t-u-d-y the "EXIST".BAT files.YOU'LL HAVE IT!  |
  45. |                                      |
  46. |----------------- T  I  M  E  M  A  S  T  E  R  ---------------------|
  47.